//
//  CreditButtonView.m
//  EasyToTesco
//
//  Created by mc on 16/1/31.
//  Copyright © 2016年 Jack. All rights reserved.
//

#import "CreditButtonView.h"

@implementation CreditButtonView



- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self addViewUI];
    }
    return self;
}

- (void)addViewUI {
    self.layer.borderWidth = 1;
    self.layer.borderColor = [UIColor colorWithRed:127/255. green:127/255. blue:127/255. alpha:1].CGColor;
    
    self.MoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, (CGRectGetHeight(self.frame)-50)/2, self.frame.size.width, 30)];
    self.MoneyLabel.font = [UIFont systemFontOfSize:25];
    self.MoneyLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.MoneyLabel];
    
    self.CountMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.MoneyLabel.frame)+5, self.frame.size.width, 15)];
    self.CountMoneyLabel.font = [UIFont systemFontOfSize:10];
    self.CountMoneyLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.CountMoneyLabel];
    
    
//    self.button = [UIButton buttonWithType:UIButtonTypeCustom];
//    self.button.frame = self.bounds;
//    [self.button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
//    [self.button setTitle:[NSString stringWithFormat:@"%@", self.CountMoneyLabel.text]forState:UIControlStateNormal];
//    self.button.alpha = 0;
//    button.backgroundColor = [UIColor greenColor];
//    [self addSubview:self.button];
}

//- (void)buttonClick:(UIButton *)button {
//    [self.delegate CreditButtonClick:button];
//}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
